<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a="http://richfaces.org/a4j"
                template="/admin/template.xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />   

 <ui:define name="topnav">
            <ui:include src="/admin/menu.xhtml">
                <ui:param name="page" value="home" />
            </ui:include>
</ui:define>          
<ui:define name="body">

    <h:messages globalOnly="true" styleClass="message"/>

    <rich:panel> 
    	<f:facet name="header">添加商品图片</f:facet>
        <h:form id="AddProductForm" styleClass="register" enctype="multipart/form-data">
            <div>
               <h:panelGrid columns="2" rendered = "#{canAddImage}">
               		<h:outputLabel value = "商品#{newProduct.productId}的图片"><em>*</em></h:outputLabel> 					
					<s:fileUpload data="#{addProduct.data}" fileName="#{addProduct.imageURL}" accept="images/png,images/jpg" />									
        	   </h:panelGrid>
        	</div>
        	<h:commandButton  value = "添加图片" action="#{addProduct.addImage}" rendered = "#{canAddImage}"/>	
        	<s:button  value = "继续添加图片" action="#{addProduct.startAddImage}" rendered = "#{!canAddImage}"/>
        	<h:commandButton  value = "完成添加商品" action="#{addProduct.complete}" />		
        	    			  
            
        </h:form>
        
    </rich:panel>

</ui:define>

</ui:composition>

